package com.hhj.king.provider.srv;

import com.hhj.king.provider.entity.Person;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author KING
 * @date 2018/9/23 17:26
 */
@Service
public class PersonServiceImpl implements PersonService {
    private String zgydNum = "10086";

    @Override
    public List<Person> getAll() {
        List<Person> personList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Person person = new Person();
            person.setId(i + "");
            person.setName("king" + i);
            person.setAge("26");
            personList.add(person);
        }
        return personList;
    }

    @Override
    public Person findById(String id) {

        Person person = new Person();
        person.setId(id + "");
        person.setName("king" + id);
        if (zgydNum.equals(id)) {
            person.setName("中国移动");
        }
        person.setAge("26");
        return person;
    }
}
